home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
codeop.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
89 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
import __future__
_features = [ getattr(__future__, fname) for fname in __future__.all_feature_names ]
__all__ = [
'compile_command',
'Compile',
'CommandCompiler']
PyCF_DONT_IMPLY_DEDENT = 512
def _maybe_compile(compiler, source, filename, symbol):
for line in source.split('\n'):
line = line.strip()
if line and line[0] != '#':
break
continue
elif symbol != 'eval':
source = 'pass'
err = None
err1 = None
err2 = None
code = None
code1 = None
code2 = None
try:
code = compiler(source, filename, symbol)
except SyntaxError:
err = None
try:
code1 = compiler(source + '\n', filename, symbol)
except SyntaxError:
err1 = None
try:
code2 = compiler(source + '\n\n', filename, symbol)
except SyntaxError:
err2 = None
if code:
return code
if not code1 and repr(err1) == repr(err2):
raise SyntaxError, err1
def _compile(source, filename, symbol):
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)
def compile_command(source, filename = '<input>', symbol = 'single'):
return _maybe_compile(_compile, source, filename, symbol)
class Compile:
def __init__(self):
self.flags = PyCF_DONT_IMPLY_DEDENT
def __call__(self, source, filename, symbol):
codeob = compile(source, filename, symbol, self.flags, 1)
for feature in _features:
if codeob.co_flags & feature.compiler_flag:
self.flags |= feature.compiler_flag
continue
self
return codeob
class CommandCompiler:
def __init__(self):
self.compiler = Compile()
def __call__(self, source, filename = '<input>', symbol = 'single'):
return _maybe_compile(self.compiler, source, filename, symbol)